<table class="home">

<tr>
	<th class="cat_name" id="<?= $info['id'] ?>">
		<?= $info['name'] ?>
	</th>
	{admin}
		<th class="delete">
			<?= anchor('category/admin/delete/'.$info['id'], 'Delete', array('class' => 'admin delete_confirm'))?>
		</th>
	{/admin}
</tr>

<tr><td colspan="2">

<table border="0" class="single_category">
	
	<tr class="subheader">
		<td class="name">Forum</td>
		<td {admin}colspan="2"{/admin}>Latest Post</td>
	</tr>

	<? foreach($this->Forum->get_forums($info['id']) as $forum): ?>
	
	<? if ($forum == -1): ?>
	
	<tr>
		<td colspan="2" style="width: 50em; padding: 1em">
			There are no forums in this category.
		</td>
	</tr>
	
	<? else: ?>
	
	<tr class="single_forum">
		<td class="name">
			<?= anchor('forum/view/'.$forum['id'], $forum['name']) ?>
			<br/>
			<small class="forum_description" id="<?= $forum['id'] ?>"><?= $forum['description'] ?></small>
		</td>
		<td class="latest" {not_admin}style="width: 27.5em"{/not_admin}>
			<? if($forum['newest_time'] != 0): ?>
				Last Post:<br/>
					<?= anchor('topic/view/'.$forum['newest_id'], mdate('%d %F %h:%i %A', gmt_to_local($forum['newest_time'], $this->_user['timezone'], $this->_user['daylight_savings'])) ) ?>
			<? else: ?>
				Forum is empty
			<? endif; ?>
		</td>
		
		{admin}
		<td class="delete"><?= anchor('forum/admin/delete/'.$forum['id'].'/'.$info['id'], 'X', array('class' => 'admin delete_confirm'))?></td>
		{/admin}
	</tr>
	<? endif; ?>
	<? endforeach; ?>
	
</table>

</td></tr>

{admin}
<tr><td colspan="2" class="add_forum">
	<?= anchor('forum/admin/add/'.$info['id'], 'Add a forum', array('class' => 'admin')) ?>
</td></tr>
{/admin}

</table>

{admin_box}
{/admin_box}